Network devices (or network nodes) connected by a software-defined networking in a wide area network (SD-WAN) are often unable to identify an optimal path for routing a packet from one network node to another. Usually, a route with the shortest number of hops (i.e. a route that will traverse the smallest number of network nodes) is selected. However, often, the route that will traverse the smallest number of nodes is not a route that has the least latency or the largest bandwidth. For example, the latency can be affected by a blackout or brown at some point in the network. In such situations routing based on shortest number of hops is highly inefficient.